package org.springblade.common.exception;

import org.springblade.common.enums.TrainingResultCode;

public class TrainingServiceException extends RuntimeException {
	private final TrainingResultCode resultCode;

	public TrainingServiceException(String message) {
		super(message);
		this.resultCode = TrainingResultCode.SERVICE_FAILURE;
	}

	public TrainingServiceException(TrainingResultCode resultCode) {
		super(resultCode.getMessage());
		this.resultCode = resultCode;
	}

	public TrainingServiceException(TrainingResultCode resultCode, Throwable cause) {
		super(cause);
		this.resultCode = resultCode;
	}

	public Throwable fillInStackTrace() {
		return this;
	}

	public Throwable doFillInStackTrace() {
		return super.fillInStackTrace();
	}

	public TrainingResultCode getResultCode() {
		return this.resultCode;
	}
}
